import request from '@/utils/request'

export const getEmployeesAPI = (params) => {
  return request({ url: '/sys/user', params })
}
export const exportAPI = () => {
  return request({
    url: '/sys/user/export',
    responseType: 'blob'
  })
}

export const getTemplateAPI = () => {
  return request({
    url: '/sys/user/import/template',
    responseType: 'blob'
  })
}

export const uploadExcelAPI = (data) => {
  return request({
    url: '/sys/user/import',
    method: 'post',
    data
  })
}
export const delAPI = (id) => {
  return request({
    url: `/sys/user/${id}`,
    method: 'delete'
  })
}

export const addEmployeeAPI = (data) => {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}

export const updateEmployeeAPI = (data) => {
  return request({
    url: '/sys/user/' + data.id,
    method: 'put',
    data
  })
}

export const gerEmployeeDetailAPI = (id) => {
  return request({
    url: '/sys/user/' + id

  })
}
